from fastapi import APIRouter
from public.wx_public import sign_sha1router = APIRouter()@router.get("/", summary="微信服务器配置验证")
async def handle_wx(signature, timestamp, nonce, echostr):try:if sign_sha1(signature, timestamp, nonce):return int(echostr)else:logger.error("加密字符串 不等于 微信返回字符串，验证失败！！！")return "验证失败！"except Exception as error:return f"微信服务器配置验证出现异常:{error}"